import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;



public class ServletData02 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setContentType("text/html;charset=utf-8");
        PrintWriter out=resp.getWriter();
        ServletContext context =this.getServletContext();
        String str=(String)context.getAttribute("str");
        out.print("<html>");
        out.println("<body>");
        out.println("<h3>"+str+"<h3>");
        out.println("</body>");
        out.println("</html>");
        out.flush();
        out.close();
    }
}
